package com.zzw.algorithm.tree;

import java.util.Map;

/**
 * created by zzw
 */
public class TreeNode<K,V> implements Map.Entry<K,V>{

    private K key;
    private V value;
    public TreeNode<K,V> left;
    public TreeNode<K,V> right;

    public TreeNode() {
    }

    public TreeNode(K key, V value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public K getKey() {
        return key;
    }

    @Override
    public V getValue() {
        return value;
    }

    @Override
    public V setValue(V value) {
        this.value = value;
        return value;
    }

    @Override
    public String toString() {
        return "TreeNode{" +
                "key=" + key +
                ", value=" + value +
                '}';
    }
}
